package awt;

import java.awt.BorderLayout;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class Demo10 extends JFrame {
	JTextArea jta;
	JPanel jp;
	JButton jb;
	JComboBox jcb;
	JTextField jtf;
	JScrollPane jsp;

	public Demo10() {

		jta = new JTextArea();
		jp = new JPanel();
		String[] friends = { "布什", "克林顿", "奥巴马" };
		jcb = new JComboBox(friends);
		jb = new JButton("发送");
		jtf = new JTextField(10);
		jsp = new JScrollPane(jta);
		jp.add(jcb);
		jp.add(jtf);
		jp.add(jb);
		this.add(jsp, BorderLayout.CENTER);
		this.add(jp, BorderLayout.SOUTH);
		this.setTitle("腾讯QQ");
		this.setIconImage((new ImageIcon("images/pic1.jpg").getImage()));
		this.setSize(300, 300);
		this.setLocation(100, 200);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setVisible(true);

	}

	public static void main(String[] args) {
		Demo10 demo8 = new Demo10();

	}

}
